package com.aliyun.messagemgt.util.redis;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IDEA
 *
 * @author:zhangxingxing 0027012120
 * @date:2019/1/30
 * @time:15:32
 */
@Configuration
public class RedisInitialization implements InitializingBean {

    @Value("${spring.redis.host}")
    private String redisHost;
    @Value("${spring.redis.password}")
    private String redisPassword;
    @Value("${spring.redis.port}")
    private Integer redisPort;

    @Override
    public void afterPropertiesSet() throws Exception {
        Redis.setup(redisHost,redisPassword, redisPort, 1000);
    }
}
